<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>等级管理</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/style.css" />
<script src="__PUBLIC__/js/jquery.js" type="text/javascript"></script>
<script src="__PUBLIC__/artDialog/jquery.artDialog.js?skin=twitter" type="text/javascript"></script>
<script src="__PUBLIC__/artDialog/plugins/iframeTools.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/common.js" type="text/javascript"></script>
<style type="text/css">
input{margin:5px;}
</style>
</head>
<body>
<div id="main">
<form id="login-form" action="__URL__/groupedit.html" method="post">
<input type="hidden" value="post" name="action" />
<input type="hidden" name="fid" value="{$arrlist['id']}" />
<fieldset id="source"><legend>权限组名称：<input id="name" type="text" name="name" class="input-text" size="30" value="{$arrlist['name']}" /></legend>
{loop $list $vo}
<fieldset id="source">
<legend>{$vo['name']}</legend>
<?php 
$czlist=module('manage')->getAction($vo['id']);
?>
{loop $czlist $val}
    <input cssrain="one" name="qx[]" type="checkbox" value="{$val['id']}"{if in_array($val['id'],$info['power_value'])}checked="checked"{/if}>{$val['name']}
{/loop}
</fieldset>
{/loop}
<input style="border: none" class="button01-out" type="button" id="checkall1" value="全选" />
<input style="border: none" class="button01-out" type="button" id="checktog1" value="反选" />
<input style="border: none" class="button01-out" type="button" id="checkoff1" value="取消" /> 
</fieldset>
</form>
</div>
<script type="text/javascript">
    $(function () {
        var parent = art.dialog.parent,	// 父页面window对象
        api = art.dialog.open.api,//art.dialog.open扩展方法
        $ = function (id) {return document.getElementById(id)},
        form = $('login-form'),
        name = $('name');
        if (!api) return;
        api.title('添加/编辑')// 操作对话框
        .button({ // 自定义按钮
            name: '提交',
            callback: function () {
                if (check(name)) form.submit();
                return false;
            },focus: true
        },{name: '取消'});
        // 表单验证
        var check = function (input) {
            if (input.value === '') {
                inputError(input);
                input.focus();
                return false;
            } else {
                return true;
            };
        };
        // 输入错误提示
        var inputError = function (input){
            clearTimeout(inputError.timer);
            var num = 0;
            var fn = function () {
                inputError.timer = setTimeout(function () {
                    input.className = input.className === '' ? 'login-form-error' : '';
                    if (num === 5) {
                        input.className === '';
                    } else {
                        fn(num ++);
                    };
                }, 150);
            };
            fn();
        };
        window.onload = function () {setTimeout(function () {username.focus()}, 240);};
    })();
</script>
</body>
</html>